Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config compiler #304

Merged
merged 5 commits into from
Aug 2, 2023
Merged

Config compiler #304

merged 5 commits into from
Aug 2, 2023

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Jul 31, 2023

We were treating configuration files in the project's config directory
like normal elixir source files, but they're slightly different, and
compiling them will cause errors to appear.

This change adds a config compiler that uses Config.Reader to compile
configuration.

Fixes #301

@scohen scohen requested a review from scottming July 31, 2023 20:39
@scohen scohen changed the base branch from main to support-eex-compilation July 31, 2023 20:39
Base automatically changed from support-eex-compilation to main August 1, 2023 15:00
We were treating configuration files in the project's config directory
like normal elixir source files, but they're slightly different, and
compiling them will cause errors to appear.

This change adds a config compiler that uses Config.Reader to compile
configuration.

Fixes #301
I wasn't using Code.with_diagnostics, and was getting the dreaded
"errors have been logged" message
Copy link
Collaborator

@scottming scottming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this branch in some projects and found that the config folder under umbrella is not recognized, or using import_config "#{config_env()}.exs" is also problematic, but I think it might be a result of incorrect configuration.

@scohen
Copy link
Collaborator Author

scohen commented Aug 2, 2023

What do you mean? Errors are emitted just fine in the lexical project.

@scohen scohen merged commit d556fa2 into main Aug 2, 2023
5 checks passed
@scohen scohen deleted the config-compiler branch August 2, 2023 05:58
@scottming
Copy link
Collaborator

Sorry, maybe I didn't explain it clearly enough. What I meant was that some sub-apps have already specified the config_path: "../../config/config.exs", but someone still created a config directory in the app, which caused recognition failure.

So never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lexical currently does not work with config/*.exs
2 participants